class Page < ActiveRecord::Base
  validates_presence_of :title, :message => "can't be blank"
  validates_uniqueness_of :title, :message => "is already in use by another page"
  
  has_many :revisions
  has_many :comments, :through => :revisions, :order => "comments.created_at DESC", :include => :user
  belongs_to :wiki
  
  def name; title; end
end
